
Ext.define('PrjAPLean.view.user.FunctionManagerWin', {
    extend: 'Ext.window.Window',
    alias: 'widget.functionmanagerwin',

    requires: [
        'PrjAPLean.view.user.FunctionManagerWinViewModel',
        'PrjAPLean.view.user.FunctionManagerWinViewController',
        'Ext.tree.Panel',
        'Ext.tree.View'
    ],

    controller:'functionmanagerwin',

    viewModel: {
        type: 'functionmanagerwin'
    },
    height: 550,
    width: 530,
    listeners: {
    	show: 'onWinShow'
    },
    title: '功能权限管理',
    modal: true,
    //autoScroll: true,
    closable: true,
    items: [
		{
			  xtype: 'container',
			  layout: 'column',
			  items: [
					{
						   xtype: 'combobox',
						   fieldLabel: 'Dimension',
						   labelWidth: 85,
						   columnWidth: 0.5,
						   labelAlign: 'right',
						   margin: '5 0',
						   displayField: 'name',
						   emptyText: '请选择',
						   valueField: 'id',
						   allowBlank: false,
						   editable: false,
						   bind: {store: '{dimkey}'},
						   listeners: {
							   change: 'onDimensionSelect'
						   }
					},     
					{
						xtype: 'combobox',
						fieldLabel: 'Role',
						labelWidth: 50,
						columnWidth: 0.4,
						labelAlign: 'right',
						margin: '5 0',
						displayField: 'name',
						emptyText: '请选择',
						valueField: 'id',
						allowBlank: false,
						editable: false,
						itemId: 'role',
						bind: {store: '{role}'}
					},    
					{
						xtype: 'button',
						text: '新增',
						margin: '3 5',
						columnWidth: 0.1,
						handler: 'onAddGroupRole'
					}    
			  ]
		},
       {
	    	  xtype: 'container',
	    	  autoScroll: true,
	    	  height:230,
	    	  items:[
	    	         {
	    	        	 xtype: 'container',
	    				 itemId: 'orgTreeContainer'   
	    	         }
	    	  ]
       },
       {
         	xtype: 'button',
             text: '删除',
             margin: '3 3',
             icon:'images/delete.png',
             handler: 'onDeleteClick'
       },
       {
    	   xtype: 'container',
    	   autoScroll: true,
    	   height:200,
    	   items:[
    	          {
	    	  xtype: 'grid',
	    	  itemId: 'groupRoleGrid',
	    	  selModel: {selType: 'checkboxmodel', mode: 'SIMPLE'},
	    	  bind: '{groupRole}',
	    	  columns: [
	  	              {
	  	                  xtype: 'gridcolumn',
	  	                  dataIndex: 'groupName',
	  	                  width: '45%',
	  	                  text: 'Group'
	  	              },
	  	              {
		            	  xtype: 'gridcolumn',
		            	  dataIndex: 'roleName',
		            	  width: '45%',
		            	  text: 'Role'
	  	              },
	  	              {
	  	            	  xtype: 'gridcolumn',
	  	            	  hidden: true,
	  	            	  dataIndex: 'groupId'
	  	            	  
	  	              },
	  	              {
	  	            	  xtype: 'gridcolumn',
	  	            	  hidden: true,
	  	            	  dataIndex: 'roleId'
	  	            	  
	  	              }
	  	       ]/*,
	  	     dockedItems: [
	  	                 {
	  	                     xtype: 'toolbar',
	  	                     dock: 'top',
	  	                     items: [
	  	                         {
	  	                        	xtype: 'button',
	  	                            text: '删除',
	  	                            icon:'images/delete.png',
	  	                            handler: 'onDeleteClick'
	  	                         }
	  	                         ]
	  	                 }
	  	      ]*/
	     }
    	          ]
       }
	     /*{
	    	  xtype: 'grid',
	    	  height: 200,
	    	  autoScroll: true,
	    	  itemId: 'groupRoleGrid',
	    	  selModel: {selType: 'checkboxmodel', mode: 'SIMPLE'},
	    	  bind: '{groupRole}',
	    	  columns: [
	  	              {
	  	                  xtype: 'gridcolumn',
	  	                  dataIndex: 'groupName',
	  	                  width: '45%',
	  	                  text: 'Group'
	  	              },
	  	              {
		            	  xtype: 'gridcolumn',
		            	  dataIndex: 'roleName',
		            	  width: '45%',
		            	  text: 'Role'
	  	              },
	  	              {
	  	            	  xtype: 'gridcolumn',
	  	            	  hidden: true,
	  	            	  dataIndex: 'groupId'
	  	            	  
	  	              },
	  	              {
	  	            	  xtype: 'gridcolumn',
	  	            	  hidden: true,
	  	            	  dataIndex: 'roleId'
	  	            	  
	  	              }
	  	       ],
	  	     dockedItems: [
	  	                 {
	  	                     xtype: 'toolbar',
	  	                     dock: 'top',
	  	                     items: [
	  	                         {
	  	                        	xtype: 'button',
	  	                            text: '删除',
	  	                            icon:'images/delete.png',
	  	                            handler: 'onDeleteClick'
	  	                         }
	  	                         ]
	  	                 }
	  	      ]
	     }*/
	    	  
	   
       
    ],
    buttons: [
        {text:'保存',handler:'onSaveClick' },
        {text:'取消',handler:'onCancelClick' }
    ]

});